package user;

import com.opensymphony.xwork2.ActionSupport;

public class RegisterAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private User user=new User();
	private UserDao userDao;
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public UserDao getUserDao() {
		return userDao;
	}
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
	public String register(){
		if(user.getId()==null){
			userDao.create(user);
		}else{
			userDao.update(user);
		}
		return SUCCESS;
	}
	public String input(){
		return "input";
	}
	public String execute(){
		return SUCCESS;
	}
}
